﻿<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
                   assembly="ProgressTracker.Data"
                   namespace="ProgressTracker.Data.Entities">
  <class name="Task" table="Tasks">
    <id name="Id" type="int" generator="identity"/>
    <property name="Name" column="Name" type="string"/>
    <property name="Description" column="Description" type="string"/>
    <property name="Archived" column="Archived" type="bool" />
    <many-to-one name="User" column="UserId"/>
    <bag name="DayTasks"
         inverse="true"
         lazy="false"
         cascade="all">
      <key column="TaskId" on-delete="cascade"/>
      <one-to-many class="DayTask"/>
    </bag>
  </class>
  
</hibernate-mapping>